﻿using FxSuperCore.Utils;
using FxWinSuper.Plugin;
using FxWinSuper.Plugin.Extension;
using FxWinSuper.UI.Controls;
using FxWinSuper.Util;
using WinSupperUpdateService.Properties;
using WinSupperUpdateService.Store;

[assembly:WinSupperPlugin(" WinSupperUpdateService", "风珝", "为软件与插件提供更新服务", "1.0", 1, true)]
namespace WinSupperUpdateService
{
    public class WinSupperUpdateServicePlugin : IWinSupperPlugin
    {
	    public void Install()
	    {
		    // Console.WriteLine("WinSupperUpdateServicePlugin Install");
	    }

	    public void Enter()
	    {
		    // PluginMetaTester.GenerateMetaFile();
			PluginHelper.InstallPluginStore(MinioPluginStore.Instance);
			ApplicationUtil.RegisterContextMenuItem(new FxContextMenuItem()
			{
				Icon = CommonUtils.ConvertBitmapToBitmapImage(ResourceWinUpdateService.update),
				Title = "检测更新",
				Click = () =>
				{
					ApplicationUtil.CloseNotifyIconContextMenu();
					MinioPluginStore.Instance.DetectMainSoftwareVersion(true);
				}
			});
	    }

	    public void Exit()
	    {
		    // Console.WriteLine("WinSupperUpdateServicePlugin Exit");
		}

	    public void Uninstall()
	    {
		    // Console.WriteLine("WinSupperUpdateServicePlugin Uninstall");
		}
    }
}
